﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WuDada.Core.Post.Domain;
using WuDada.Core.Member.Domain;

namespace WuDada.Core.Post.Service
{
    public interface IAnswerService
    {
        /// <summary>
        /// 新增Answer
        /// </summary>
        /// <param name="answerVO">被新增的Answer</param>
        /// <returns>新增後的Answer</returns>
        AnswerVO CreateAnswer(AnswerVO answerVO);

        /// <summary>
        /// 取得Answer By AnswerId
        /// </summary>
        /// <param name="answerId">AnswerId</param>
        /// <returns>Answer</returns>
        AnswerVO GetAnswerById(int answerId);

        /// <summary>
        /// 刪除Answer
        /// </summary>
        /// <param name="answerVO">被刪除的Answer</param>
        void DeleteAnswer(AnswerVO answerVO);

        /// <summary>
        /// 更新Answer
        /// </summary>
        /// <param name="answerVO">被更新的Answer</param>
        /// <returns>更新後的Answer</returns>
        AnswerVO UpdateAnswer(AnswerVO answerVO);

        /// <summary>
        /// 取得Answer清單
        /// </summary>
        /// <param name="conditions">搜尋條件</param>
        /// <returns>Answer清單</returns>
        IList<AnswerVO> GetAnswerList(IDictionary<string, string> conditions);

        /// <summary>
        /// 取得Answer數量
        /// </summary>
        /// <param name="conditions"></param>
        /// <returns></returns>
        int GetAnswerCount(IDictionary<string, string> conditions);

        /// <summary>
        /// 新增AnswerDetail
        /// </summary>
        /// <param name="answerDetailVO">被新增的AnswerDetail</param>
        /// <returns>新增後的AnswerDetail</returns>
        AnswerDetailVO CreateAnswerDetail(AnswerDetailVO answerDetailVO);

        /// <summary>
        /// 取得AnswerDetail By AnswerDetailId
        /// </summary>
        /// <param name="answerDetailId">AnswerDetailId</param>
        /// <returns>AnswerDetail</returns>
        AnswerDetailVO GetAnswerDetailById(int answerDetailId);

        /// <summary>
        /// 刪除AnswerDetail
        /// </summary>
        /// <param name="answerDetailVO">被刪除的AnswerDetail</param>
        void DeleteAnswerDetail(AnswerDetailVO answerDetailVO);

        /// <summary>
        /// 更新AnswerDetail
        /// </summary>
        /// <param name="answerDetailVO">被更新的AnswerDetail</param>
        /// <returns>更新後的AnswerDetail</returns>
        AnswerDetailVO UpdateAnswerDetail(AnswerDetailVO answerDetailVO);

        /// <summary>
        /// 取得AnswerDetail清單
        /// </summary>
        /// <param name="conditions">搜尋條件</param>
        /// <returns>AnswerDetail清單</returns>
        IList<AnswerDetailVO> GetAnswerDetailList(IDictionary<string, string> conditions);

        /// <summary>
        /// 取得AnswerDetail數量
        /// </summary>
        /// <param name="conditions"></param>
        /// <returns></returns>
        int GetAnswerDetailCount(IDictionary<string, string> conditions);

        /// <summary>
        /// 產生一個空白的問卷回答
        /// </summary>
        /// <param name="postId">關聯的主題Id</param>
        /// <param name="needQuestionNum">需要幾個題目</param>
        /// <param name="memberVO">會員</param>
        /// <returns></returns>
        AnswerVO CreateEmptyAnswer(int postId, int needQuestionNum, MemberVO memberVO);

        /// <summary>
        /// 完成問卷
        /// </summary>
        /// <param name="answerVO"></param>
        /// <param name="passScore">及格分數</param>
        /// <returns></returns>
        AnswerVO UpdateFinishAnswer(AnswerVO answerVO, double passScore);
    }
}
